<div class="new_bd clearfix">
        <?php echo $this->render('index/left.phtml');?>
        <!-- 主栏 -->
        <div class="new_mn">
    		<div class="w-blk0 new_blk_pdlshow">
                <h1 class="blk0h2 f-iblk clearfix">
                <span class="spbg blkhdl"><a href="<?php echo MY_URL?>">Home</a> &gt; <?=$this->parentArray[count($this->parentArray)-2]?> &gt; <?=$this->parentArray[count($this->parentArray)-1]?>
		
		<div style="float: right; margin-right: 8px;">
							<select onchange="changeMode(this);" id="order" style="width:100px;">
								<option value="0">New arrival</option>
								<option value="2">Price: lowest first</option>
								<option value="1">Price: highest first</option>                            
							</select>
						</div>
		
		
		</span>
                    
	                    
					              
                </h1>
               
               	<?php if($this->page == 1 && !is_array($this->selectedProductAttributes)):?>
                <div style="padding: 10px; border: 1px solid #999; border-bottom: none;">
                	<?php if ($this->currentFenlei[0]['fenlei_description']):?>
                	<div class="cate-desc"><?php echo str_replace("\n","<br />",$this->currentFenlei[0]['fenlei_description']);?></div>
                	<?php endif;?>
                </div>
                <?php endif;?>
                
                <?php if($this->page == 1 && count($this->topProductArray)>0):?>
                <div class="w-blk0 new_blk_pdshowTop">
                    <div class="blkbodyTop">
                        <h2 style="padding:10px 0px 0px 10px;">You can customize the jersey with name, number and patch.</h2>
                        <ul class="clearfix">
                            <?php foreach ($this->topProductArray as $value):?>
                                <li>
                                    <div class="prd simg"><img alt="<?php echo $value['subject'];?>" title="<?php echo $value['keywords'];?>" src="<?php echo MY_URL;?>/<?php echo $value['cut_url'];?>" /></div>
                                    <div class="prd spname"><a href="<?php echo $this->url($value['itemid']);?>" title="<?php echo str_replace("\"",'',$value['description']);?>"><?php echo $value['subject'];?></a></div>
                                    <div class="prd sprice"><a class="sprice spbg f-blk" href="<?php echo $this->url($value['itemid']);?>" title="<?php echo $value['subject'];?>">Price <span class="delete">$<?php echo $value['m_org_price'];?></span> <strong>$<?php echo $value['max_price'];?></strong></a></div>
                                    <div><a class="f-blk pboxbar spbg" href="<?php echo $this->url($value['itemid']);?>" title="<?php echo $value['subject'];?>">&nbsp;</a></div>
                                    <?php if(isset($value['isTop']) && $value['isTop']==1):?><a style="left:110px;" href="<?php echo $this->url($value['itemid']);?>" class="customize-prd f-iblk"></a><?php endif;?>
                                </li>
                            <?php endforeach;?>                        
                        </ul>
                    </div>
                </div>
                <?php endif;?>
                
                <div class="blkbody">
                <ul class="clearfix">
                	<?php if(count($this->itemArray) > 0):?>
	                <?php foreach($this->itemArray as $value):?>
	                  <li class="clearfix">                    	
	                     <div class="prd simg"><a href="<?php echo $this->url($value['itemid']);?>" title="<?php echo $value['subject'];?>"><img alt="<?php echo $value['pattern_intro'];?>" title="<?php echo $value['pattern_intro'];?>" src="<?php echo MY_URL;?>/<?php echo $value['cut_url'];?>" onerror="javascript:this.src ='<?=MY_URL?>/html/images/nothingpic.jpg'" /></a></div>
	                     <div class="prdl">
                         	<h2 class="spname"><a href="<?php echo $this->url($value['itemid']);?>" title="<?php echo $value['subject'];?>"><?php echo $value['subject'];?></a></h2>
                            <div class="description"><?php echo $value['description'];?></div>
	                     	<div class="sprice clearfix"><a class="spbg f-iblk priceA" href="<?php echo $this->url($value['itemid']);?>" title="<?php echo $value['subject'];?>">Price <span class="delete">$<?php echo $value['m_org_price'];?></span> <strong>$<?php echo $value['max_price'];?></strong></a><a class="buynowA spbg f-iblk" href="<?php echo $this->url($value['itemid']);?>">BUY&nbsp;&nbsp;NOW</a></div>
                         	<a style="top:-22px;left:-170px;" href="<?php echo $this->url($value['itemid']);?>" class="discount-prd f-iblk"><?php echo intval(($value['m_org_price']-$value['max_price'])/$value['m_org_price']*100) ?>%</a>
                         </div>
                      </li>
	                <?php endforeach;?> 
	                <?php else:?>
	                	<div style="line-height: 28px;text-align: center;">sorry, no item found</div>
	                <?php endif;?>                      
                </ul>                
                </div>   
                <div class="pages clearfix" style="margin-top: 10px;">
					<div class="g-pages-style">
						<?=$this->pageString?>
					</div>
				</div>            
            </div>
         
        </div>
    </div>
<script type="text/javascript">
	function changeMode(thisSelect){
		var href = window.location.href.split('?')[0];
		new_href = href.replace(/\/(\w+)-(\d+)-(\d+)-(\d+)-(\w+).html$/, '\/$1-$2-'+thisSelect.value+'-$4-$5.html');
		//window.location.href=href+"?order="+thisSelect.value+'&page=<?=$this->page?>';
		window.location.href = new_href;
	}
	
	function changePage(thisSelect){
		var href = window.location.href.split('?')[0];
		new_href = href.replace(/\/(\w+)-(\d+)-(\d+)-(\d+)-(\w+).html$/, '\/$1-$2-$3-'+thisSelect.value+'-$5.html');		
		window.location.href = new_href;
	}
	$('#order').val('<?php echo $this->order;?>');
</script>
